\documentclass[11pt]{article}
\usepackage{amsmath,amsthm,amsfonts,amssymb,mathrsfs,epsfig,bm}
\usepackage{color}
\usepackage{xspace}
%\usepackage{/home/takis2/MYLATEX/undertilde}
%\usepackage{ccfonts}
%\usepackage{euler}
%\usepackage{txfonts}
%\usepackage{mathptmx}
%\usepackage{cmbright}
%\usepackage{lucidabr}
%%\usepackage{fourier}
%\usepackage[english,greek]{babel}
%\usepackage[iso-8859-7]{inputenc}
\oddsidemargin	0.635cm
\textwidth	15.3cm
\topmargin	-1cm
\textheight	23cm
\parindent	0pt
\parskip 	\smallskipamount
%%%%%%%%%%%THEOREMS%%%%%%%%%%%
\newtheorem{theorem}{Theorem}%[section]
\newtheorem{lemma}{Lemma}
\newtheorem{corollary}{Corollary}
\newtheorem{proposition}{Proposition}
\theoremstyle{remark}
\newtheorem{property}{Property}
\newtheorem{remark}{Remark}
\newtheorem{example}{Example}
%%%%%%%%%%%LETTERS%%%%%%%%%%%
\def\N{\mathbb{N}}
\def\Z{\mathbb{Z}}
\def\Q{\mathbb{Q}}
\def\R{\mathbb{R}}
\def\C{\mathbb{C}}
\def\FF{\mathscr{F}}
\def\BB{\mathscr{B}}
\def\LL{\mathcal{L}}
\def\QQ{\mathcal{Q}}
\renewcommand{\phi}{\varphi}
\renewcommand{\epsilon}{\varepsilon}
%%%%%%%%%%%SYMBOLS & OPERATORS%%%%%%%%%%%
\newcommand{\1}{{\text{\Large $\mathfrak 1$}}}
\newcommand{\comp}{\raisebox{0.1ex}{\scriptsize $\circ$}}
\newcommand{\cadlag}{{c\`adl\`ag} }
\newcommand{\var}{\operatorname{var}}
\newcommand{\cov}{\operatorname{cov}}
\renewcommand{\limsup}{\varlimsup}
\renewcommand{\liminf}{\varliminf}
\renewcommand{\d}{\text{\rm\,d}}
\newcommand{\eqdist}{\stackrel{\text{d}}{=}}
\newcommand{\dirac}{\text{\large $\mathfrak d$}}
\newcommand{\Ri}{\Rightarrow}
\def\iid{{i.i.d.}\xspace}
\def\ie{{i.e.}\xspace}
\def\eg{{e.g.}\xspace}
%A \xrightarrow[n]{} 0
%\sum_{\substack {A \\ B}}
\definecolor{mygray}{gray}{0.9}
\def\Pr{\operatorname{\bf P}}
\def\E{\operatorname{\bf E}}




\begin{document}


\begin{center}
\large \bf
Solutions to Exercises of Chapters 3, 4 and 5
\end{center}

\begin{center}{\bf CHAPTER 3}\end{center}

%%%%%%%%%%%%%%%%%%%%
\paragraph{3.1}
The $\sigma$-algebra $\sigma(X)$
consists of all subsets of $X(\Omega)$. 
A set with $n$ elements has precisely $2^n$ subsets.
Hence $\sigma(X)$ consists of $2^n$ sets. 
Each of these sets can be obtained as follows:
Let $x_1, \ldots, x_n$ be the distinct values of $X$.
Enumerate the binary strings of $0$'s and $1$'s of length $n$
and to each of them assign a set from $\sigma(X)$.
The way to do this should be clear from the following example with $n=3$:

\begin{tabular}{ll}
000 : & $\{X \not= x_1, X \not= x_2, X \not = x_3 \}=\varnothing$ \\
001 : & $\{X \not= x_1, X \not= x_2, X = x_3 \}=\{X=x_3\}$ \\
010 : & $\{X \not= x_1, X = x_2, X \not = x_3 \}=\{X=x_2\}$ \\
011 : & $\{X \not= x_1, X = x_2, X = x_3 \}=\{X=x_2 \text{ or } x_3\}$ \\
100 : & $\{X = x_1, X \not= x_2, X \not = x_3 \}=\{X=x_1\}$ \\
101 : & $\{X = x_1, X \not= x_2, X = x_3 \}=\{X=x_1 \text{ or  }x_3\}$ \\
110 : & $\{X = x_1, X = x_2, X \not = x_3 \}=\{X=x_1 \text{ or } x_2\}$ \\
111 : & $\{X = x_1, X = x_2, X = x_3 \}=\Omega$ 
\end{tabular}


%%%%%%%%%%%%%%%%%%%%
\paragraph{3.2}
(i) If $x_1 < x_2$ then $\{X \le x_1\} \subset \{X \le x_2\}$.
\\
(ii) $\lim_{x \to -\infty} F(x) = \lim_{n \to -\infty} F(n)$,
where $n$ ranges over the integers. But $F(n) = \Pr(X\le n)$ decreases
as $n$ decreases, and so 
\[
\lim_{n \to -\infty} F(n) = \Pr \big( \bigcap_{n\in \Z} \{X \le n\}\big)
=\Pr(\varnothing) =0.
\]
(iii) Similarly,
\[
\lim_{n \to +\infty} F(n) = \Pr \big( \bigcup_{n\in \Z} \{X \le n\}\big)
=\Pr(\Omega) =1.
\]
(iv) \[
\bigcap_{n \in \N} (-\infty, x+1/n] = (-\infty, x].
\]


%%%%%%%%%%%%%%%%%%%%
\paragraph{3.3}
For $a \le  b$:
(i) 
\[
(a, b] = (-\infty, b] \setminus (-\infty, a]
\]
and $(-\infty, a] \subset (-\infty, b]$.
\\
(ii)
Observe that
\[
(a, b) = \bigcup_{n \in \N} (a, b-1/n]
\]
and use (i) to get
\[
\Pr (X \in (a,b) ) = \lim_{n \to \infty} (F(b-1/n)-F(a))
= F(b-)-F(a).
\]
(iii)
Observe that
\[
[a, b] = \bigcap_{n \in \N} (a-1/n, b]
\]
and use (i) to get
\[
\Pr (X \in [a,b] ) = \lim_{n \to \infty} (F(b)-F(a-1/n))
= F(b)-F(a-).
\]
(iv)
Apply (iii) with $a=b$.


%%%%%%%%%%%%%%%%%%%%
\paragraph{3.4}
The way that $F^{-1}$ is defined in the lecture notes is:
\[
F^{-1}(t) := \inf A_t, \text{ where } A_t:=\{x\in \R:~ F(x) \ge t\}.
\]
By the definition of the infimum of a set of real numbers
(the set $A_t$, in this case),
$F^{-1}(t)$ is the largest of all numbers $c$ which are lower bounds to
the set (the existence of which is guaranteed by the completeness property
of the set of real numbers--a consequence of its construction):
\[
F^{-1}(t) \ge c \iff
x \ge c \text{ for all } x \in A_t.
\]
Equivalently,
\[
F^{-1}(t) \ge c \iff
\text{ for all } x < c ,~~ x \not \in A_t \iff
\text{ for all } x < c ,~~ F(x) < t.
\]
Instead of saying ``for all $x < c$'' we can say ``for all $x=c-\epsilon$
with $\epsilon > 0$'', and so
\[
F^{-1}(t) \ge c \iff
F(c-\epsilon) < t \text{ for all } \epsilon > 0
\iff F(c-) < t.
\]
Therefore,
\[
F^{-1}(t) < c \iff t \le F(c-),
\]
This holds for all $t$ and $c$ and so, by setting $t=U$, we obtain 
\[
\Pr(F^{-1}(U) < c) = \Pr(U \le F(c-) ) = F(c-),
\]
the latter due to the assumption that $U$ is uniformly distributed on
the interval $(0,1)$.
Hence
\[
\Pr(F^{-1}(U) \le x) = \lim_{n \to \infty}\Pr(F^{-1}(U) < x+1/n)
= \lim_{n\to \infty} F((x+1/n)-)
= \lim_{n\to \infty} F(x+1/n) = F(x).
\]

%%%%%%%%%%%%%%%%%%%%
\paragraph{3.5}

The function $V : \{0,1\}^\N \to \R$ is defined by
\[
V(\omega) = \sum_{k=1}^\infty 2\omega_k 3^{-k},
\quad \omega_1, \omega_2, \ldots \in \{0, 1\},
\]
and $\Pr$ is a measure on the cylinder-$\sigma$-algebra $\FF$ of 
$\{0,1\}^\N$ such that
\[
\Pr(\omega_1=\epsilon_1, \ldots, \omega_n =\epsilon_n)=2^{-n},
\]
for all $n \in \N$, and all $\epsilon_1, \ldots, \epsilon_n \in \{0,1\}$.
We consider the distribution function 
\[
F(x) = \Pr(V \le x)
\]
of $V$. 
%(We here take the left-continuous version of $F$,
%because it is convenient to do so. Observe that the right-continuity
%of the definition in the lectures is just a convention which we can change
%if we like.)
Define $V'(\omega)$ by
\[
V(\omega) = \frac{2\omega_1}{3}  + \frac{1}{3} V'(\omega).
\]
Observe that the $\Pr$-law of $V'$ is the same as the $\Pr$-law of $V$
(by considering finite-dimensional cylinder sets).
Suppose $x < 1/3$. Then 
\[
F(x)= \Pr(V \le x) = \Pr(\omega_1 =0, \tfrac{1}{3} V' \le x)
=\frac{1}{2} F(3x).
\]
Suppose $x > 2/3$. Then
\[
F(x) = \Pr(V \le x) = \Pr(\omega_1=1, \tfrac{2}{3}+\tfrac{1}{3} V' \le x)
=\frac{1}{2} F(3(x-\tfrac{2}{3})).
\]
Observe that it is impossible for $V(\omega)$ to be
strictly between $1/3$ and $2/3$. Indeed, if $\omega_1=0$, then
the maximum value of $V(\omega)$ is $1/3$ (and this happens
when $V'(\omega)=1$; if $\omega_1=1$, the least value of $V(\omega)$
is $2/3$. So
\[
\{1/3 < V < 2/3\} = \varnothing.
\]
Since
\begin{align*}
\Pr(V=1/3)&= \Pr(\omega_1=0, V'=1) = \Pr(\omega_1=0,
\omega_n=1 \text{ for all } n \ge 1)=0,
\\
\Pr(V=2/3)&= \Pr(\omega_1=1, V'=0) = \Pr(\omega_1=1,
\omega_n=0 \text{ for all } n \ge 1)=0,
\end{align*}
we have
\[
\Pr(1/3 \le V \le 2/3)=0
\]
and so, for some constant $c$,
\[
F(x) = \text{c}, \quad \text{ if } 1/3 \le x \le 2/3.
\]
Since $V$ and $1-V$ have the same law we have
\[
c=1/2.
\]
In other words, if we define the operator $\QQ$ on $[0,1]^{[0,1]}$ by
\[
\QQ f (x) = 
\begin{cases}
\frac{1}{2} f(3x) , & \text{ if } 0 \le x < 1/3\\
1/2, & \text{ if } 1/3 \le x \le 2/3\\
\frac{1}{2} f(3(x-2/3)) , & \text{ if } 2/3 < x \le 1,
\end{cases}
\]
we have just shown that $F$ satisfies
\[
F = \QQ F.
\]
Now restrict $\QQ $ onto $C[0,1]$, the space of continuous
functions on $[0,1]$, equipped with the usual norm
\[
||f|| = \max_{0 \le x \le 1} |f(x)|.
\]
Observe that
\begin{gather*}
||\QQ f|| = \max_{0 \le x \le 1} |f(x)|
=\max_{0 \le x < 1/3} |f(x)|
\vee
\max_{1/3 \le x \le 2/3} |f(x)|
\vee
\max_{2/3 < x \le 1} |f(x)|
\\
=
\max_{0 \le x < 1/3} |\frac{1}{2} f(3x)|
\vee (1/2)
\vee
\max_{2/3 < x \le 1} |\frac{1}{2} f(3(x-2/3)) |
=
\frac{1}{2} ||f||.
\end{gather*}
So $\QQ $ is a contraction, and so, by completeness of $C[0,1]$
(this is the analogous of the completeness as the completeness mentioned
in Exercise 3.4),
starting from any $F_0 \in C[0,1]$, the sequence defined recursively through
\[
F_{n+1} = \QQ  F_n
\]
converges uniformly to an $F^* \in C[0,1]$ which satisfies 
\[
\QQ F^*=F^*.
\]
Note that $\QQ $ is an increasing operator, i.e.\ if $f$ is increasing
function, then so is $\QQ f$. Therefore, the limit is also increasing.
So $F^*$ is an increasing continuous function.
By observing that $\QQ $ is a contraction also on the set $D[0,1]$ of
functions on $[0,1]$ which have discontinuities of
first kind, and using the fact that $F \in D[0,1]$,
we have
\[
F=F^*
\]
and so $F$ is continuous.

To show that $F$ is not absolutely continuous, we show
that
\[
\Pr(V \in C)=1
\]
for some set $C \subset [0,1]$ with Lebesgue measure $0$.
Let $H$ be a nonempty open subset of $[0,1]$ such that
\[
\Pr(V \in H) =0.
\]
(We already saw that $H=(1/3, 2/3)$ is such a set.)
Notice that 
\begin{gather*}
\frac{1}{3} H = \{x/3: x \in H\} \subset (0,1/3),\\
\frac{2}{3}+\frac{1}{3} H=\{ (2/3)+ x/3: x \in H\} \subset (2/3,1).
\end{gather*}
Hence
\begin{gather*}
\Pr(V \in \tfrac{1}{3} H ) = \Pr(\omega_1=0 ,~
 \tfrac{1}{3} V' \in \tfrac{1}{3} H ) = \frac{1}{2} \Pr(V \in H)\\
\Pr(V \in \tfrac{2}{3} +\tfrac{1}{3} H ) = \Pr(\omega_1=1 ,~
\tfrac{2}{3}+ \tfrac{1}{3} V' \in 
\tfrac{2}{3}+ \tfrac{1}{3} H ) = \frac{1}{2} \Pr(V \in H)
\end{gather*}
So, starting with a set $H_0=H$ for which $\Pr(V\in H)=0$,
we can create a family of sets $H_n$ for which $\Pr(V\in H_n)=0$,
recursively by
\[
H_{n+1} = \frac{1}{3} H_n \cup \big(\frac{2}{3} + \frac{1}{3} H_n\big),
\quad n =1,2,\ldots
\]
Since the sets $\frac{1}{3} H_n$ and $\frac{2}{3} + \frac{1}{3} H_n$
are disjoint nonempty open sets, we have that
their lengths add up. But both sets have length equal to a third
of the length of $H_n$. So
\[
|H_{n+1}| = \frac{2}{3} |H_n|,
\]
i.e.\
\[
|H_n| = (2/3)^n |H_0|.
\]
Let 
\[
D = \cup_{n=0}^\infty {H_n},
\]
where $H_0 = (1/3, 2/3)$. 
We have
\[
\Pr(V \in D)
\le \sum_{n=0}^\infty \Pr(V \in H_n) = \sum_{n=0}^\infty 0 =0.
\]
We have $|H_0| = 1/3$, $|H_n|= 2^n/3^{n+1}$.
Observe that the $H_n$ are here disjoint. So
\[
|D| = \sum_{n=0}^\infty |H_n| = \sum_{n=0}^\infty  2^n/3^{n+1} =1.
\]
Finally, set
\[
C = [0,1] - D.
\]
We have $|C|=1-|D|=0$, and $\Pr(V \in C) = 1-\Pr(V\in D) = 1-0 =1$.




%%%%%%%%%%%%%%%%%%%%
\paragraph{3.6}
$Y=1$ if and only if $X$ divides 3, and the only possibility is $X=3$.
So $\Pr(Y=1)=1/6$, $\Pr(Y=2)=5/6$.

%%%%%%%%%%%%%%%%%%%%
\paragraph{3.7}
\[
\Pr(\phi(X) \le t) = \Pr(X \ge \psi(t))
=
\int_{\psi(t)}^\infty f(x) dx.
\]
Taking derivative with respect to $t$, we find that the density
of $\phi(X)$ equals
\[
\frac{d}{dt} \int_{\psi(t)}^\infty f(x) dx
= -\psi'(t) f(\psi(t)). 
\]
But $\psi$ is strictly decreasing, so $\psi'(t) < 0$, and so $-\psi'(t)=
|\psi'(t)|$.


%%%%%%%%%%%%%%%%%%%%
\paragraph{3.8}
Let $a > 0$.
The inverse of the function $\phi(u) := u^{1/a}$
is $\psi(y) = y^a$. We have $\psi'(y) = a y^{a-1}$.
So
\[
f_Y(y) = f_U(\psi(y)) \psi'(y) = ay^{a-1}.
\]
Clearly, $0 < y < 1$ is the range over which $f$ is $\not = 0$,
because $\phi$ maps the interval $(0,1)$ to itself.
If $a=-b < 0$, then $\phi(u) := u^{-1/b}$ maps $(0,1)$ into $(1, \infty)$.
So $Y$ has nonzero density on $(1, \infty)$ and, by the exercise above, the
density is given by
\[
f_Y(y) = f_U(\psi(y)) |\psi'(y)| = by^{-b-1}.
\]
You should sketch the functions $\phi$ and $\psi$ in both cases,
and see why, qualitatively, the results are sound, i.e.\ that the
mass gets transferred to the correct places.
E.g., the function $Y=U^{30}$ has most of its density around $0$, while
$Y=U^{1/30}$ has most of its density around $1$.



%%%%%%%%%%%%%%%%%%%%
\paragraph{3.9}
Let us write the solution in intuitive terms (using calculus),
following, of course, a method which is totally equivalent to
the theory. Let $u$ be mapped to $y$ via $y=e^u$.
Then the mass assigned on an interval of tiny length $|du|$ sitting around
the point $u$ is transferred to an interval of tiny length $|dy|$ 
sitting around the point $y$:
\[
f_Y(y) |dy| = f_U(u) |du|
\]
and, since $\frac{dy}{du} = e^u$, we have
\[
f_Y(y) e^u = f_U(u),
\]
or
\[
f_Y(y) = e^{-u} = e^{-\log y} = \frac{1}{y}.
\]
The range of interest is the image of the interval $(0,1)$ under
the map $y=e^u$, i.e.\ $y$ ranges over $(e^0, e^1)=(1,e)$.

Let us now consider the case $y=e^{a u}$, where $a$ is
a real number. The function is one-to-one for all values of $a$,
so we need not worry about multiple pre-images of a point.
Again,
\[
f_Y(y) |dy| = f_U(u) |du|
\]
Here, $\frac{dy}{du} = ae^{au}$,
and so
\[
f_Y(y) |a e^{au}| = f_U(u),
\]
i.e.
\[
f_Y(y) = \frac{1}{|a| e^{au}}.
\]
Let us not forget that we need to express this is a function of $y$, through
$y=e^{au}$, i.e.
\[
f_Y(y) = \frac{1}{|a| y}.
\]
The range of $y$ is the image of $(0,1)$ under the map $y=e^{au}$.
If $a > 0$, then $y$ ranges over $(1, e^{a})$.
If $a < 0$, then $y$ ranges over $(e^{-|a|}, 1)$.
If $a=0$ we have a degenerate situation, because $Y=1$ with probability
$1$ (no density).


%%%%%%%%%%%%%%%%%%%%
\paragraph{3.10}
({\em Note there are some typos in the statement of the exercise.})
No sweat here: the method is as above:
\[
f_Y(y) |dy| = f_X(x) |dx|
\]
We have $y = e^{x/a}$, where $a>0$,
so
$\frac{dy}{dx} = \frac{1}{a}e^{x/a}$:
\[
f_Y(y) \frac{1}{a}e^{x/a} = f_X(x),
\]
\[
f_Y(y) = e^{-x} a e^{-x/a} = a y^{-a-1}.
\]
Here $y$ ranges between $1$ and $\infty$ because $y=e^{x/a}$
maps $\{x >0\}$ onto $\{1< y < \infty\}$.



%%%%%%%%%%%%%%%%%%%%
\paragraph{3.11}
If the function $y=\phi(x)$ is non-monotonic, then each $y$ may have
multiple pre-images. So an interval of tiny length $|dy|$ located
around the point $y$ may be the image of many tiny intervals
located at the points $x_1, x_2, \ldots$, where the latter
are all pre-images of $y$ under the map $y=\phi(x)$.
Hence the ``mass'' $f_Y(y) |dy|$ is the sum
of the masses $f_X(x_i) |dx|$, $i=1,2,\ldots$:
\[
f_Y(y) |dy| = \sum_i f_X(x_i) |dx|.
\]
Let us consider the case $Y=X^2$, where $X$ is uniform on $[-1,1]$.
Then $\frac{dy}{dx} = 2x$. 
There are 2 solutions of the equation $y=x^2$, namely,
$x_1 = + \sqrt{y}$, $x_2 = - \sqrt{y}$.
So
\[
f_Y(y) = f_X(\sqrt{y}) \left|\frac{dx}{dy}\right|_{x=\sqrt{y}}+ 
f_X(-\sqrt{y})
\left|\frac{dx}{dy}\right|_{x=-\sqrt{y}}.
\]
But $f_X(x) = 1/2$, for $-1 \le x \le 1$
and $\left|\frac{dx}{dy}\right|_{x=\sqrt{y}}
= \left|\frac{dx}{dy}\right|_{x=-\sqrt{y}} = 1/(2 \sqrt{y})$,
so
\[
f_Y(y) = 1/(2\sqrt{y}), \quad 0 \le y \le 1.
\] 
Alternatively, we can argue directly as follows:
\[
\Pr (X^2 \le y) = \Pr(-\sqrt{y} \le X \le \sqrt{y}).
\]
So
\[
f_Y(y) = \frac{d}{dy} \Pr (X^2 \le y) = 
\frac{d}{dy} \int_{-\sqrt{y}}^{\sqrt{y}} \frac{1}{2} dy'
= \frac{1}{2\sqrt{y}}.
\]


%%%%%%%%%%%%%%%%%%%%
\paragraph{3.11}
In the second case,
\[
Y= X^2, \quad \text{ where $X$ is uniform on [-1,2]}
\]
every $y \in (0,1)$ has two pre-images, $x = \pm\sqrt{y}$,
but every $y \in (1,4)$ has one pre-image, $x=+\sqrt{y}$.
So
\[
f_Y(y) = 
\begin{cases}
 f_X(\sqrt{y}) \left|\frac{dx}{dy}\right|_{x=\sqrt{y}}+
f_X(-\sqrt{y}) \left|\frac{dx}{dy}\right|_{x=-\sqrt{y}}, &
0 < y < 1,
\\
f_X(\sqrt{y}) \left|\frac{dx}{dy}\right|_{x=\sqrt{y}},&
1 < y < 4.
\end{cases}
\]
Here $f_X(x) = 1/3$, $-1 \le x \le 2$ and
$\left|\frac{dx}{dy}\right| = 1/(2\sqrt{y})$ in all cases, so
\[
f_Y(y) =
\begin{cases}
1/(3\sqrt{y}), &
0 < y < 1,
\\
1/(6\sqrt{y}), &
1 < y < 4.
\end{cases}
\]
The density has a jump at $y=1$, and we don't bother to define
its value there: it is irrelevant because the density is useful
only as an object to be integrated. In other words, not defining 
the value of a density at finitely many points won't matter at all.





%%%%%%%%%%%%%%%%%%%%
\paragraph{3.12}
Same story here:
\[
f_Y(y) |dy| = (f_X(x_1) + f_X(x_2) )|dx|,
\]
where $x_1, x_2$ are the two pre-images of $y=\cosh(x)$.
Here $y$ ranges over $[1, \infty)$, and
$|\frac{dy}{dx}| = |\sinh(x)|= \sqrt{y^2-1}$.
The latter follows from the identity $\cosh^2(x)-\sinh^2(x)=1$.
Notice that $|x_1|=|x_2| = \cosh^{-1}(y)$ and the density of $X$ is symmetric
around zero.
Hence
\[
f_Y(y) = \frac{2c}{1+\cosh^{-1}(y)^2} \frac{1}{\sqrt{y^2-1}}
=
\frac{c}
{\sqrt {{y}^{2}-1}{y}^{2}+{y}^{3}-y}
\]




%%%%%%%%%%%%%%%%%%%%
\paragraph{3.13}
We have
\[
\Pr(X=a^n) = 2^{-n}, \quad n \in \N.
\]
Therefore,
\[
\E X = \sum_{n=1}^\infty (a/2)^n
\]
which is finite iff $a/2 < 1$. The sum equals $a/(2-a)$.



%%%%%%%%%%%%%%%%%%%%
\paragraph{3.14}
We have
\[
\Pr(X=n^k) = cn^{-2}, \quad n \in \N.
\]
Therefore,
\[
\E X = \sum_{n=1}^\infty c n^{-(2-k)},
\]
and the sum is finite iff $2-k > 1$. (Use, e.g., the ratio test.)



%%%%%%%%%%%%%%%%%%%%
\paragraph{3.15}
\[
\E(X; A) = \sum_{\substack {n \in \N \\ n \text{ odd}}} (a/2)^n
=\sum_{m=0}^\infty (a/2)^{2m+1}
=\frac {2a}{{a}^{2}-4}.
\]
Setting $a=1$ in the above we obtain
\[
\Pr(A) = \sum_{m=0}^\infty (1/2)^{2m+1}= \frac{2}{3},
\]
so $\E(X|A) = \E(X; A)/\Pr(A) = 3a/(a^2-4)$.
The reason that $\E(X|A^c) = a \E(X|A)$ is {\em obvious} is that
$X = a^\xi$, where $\Pr(\xi=n) = 2^{-n}$, $n \in \N$, i.e.\
$\xi$ is a geometric--and hence memoryless--random variable.



%%%%%%%%%%%%%%%%%%%%
\paragraph{3.16}
{\em The solution depends on the way that theory was presented.}



%%%%%%%%%%%%%%%%%%%%
\paragraph{3.17}
\begin{gather*}
\E N = \sum_{n=1}^\infty n e^{-\lambda} \frac{\lambda^n}{n!}
=
e^{-\lambda} \lambda \sum_{n=1}^\infty \frac{\lambda^{n-1}}{(n-1)!}
= e^{-\lambda} \lambda e^\lambda = \lambda,
\end{gather*}
where we used the Taylor expansion of the exponential function.
\begin{gather*}
\E (N^2-N) = \sum_{n=2}^\infty (n^2-n) e^{-\lambda} \frac{\lambda^n}{n!} 
= e^{-\lambda} \lambda^2 \sum_{n=2}^\infty \frac{\lambda^{n-2}}{(n-2)!}
= e^{-\lambda} \lambda^2 e^\lambda = \lambda^2. 
\end{gather*}
Hence $\E(N^2) = \E (N^2-N) + \E N = \lambda^2+\lambda$.



\newpage
\begin{center}{\bf CHAPTER 4}\end{center}

%%%%%%%%%%%%%%%%%%%%
\paragraph{4.1}
We use Chernoff's inequality as follows:
\[
\Pr(X > na) \le \frac{\E e^{\theta X}}{e^{\theta na}},
\]
where $\theta$ is a positive constant. Now,
\[
\E e^{\theta X} 
= \sum_{k=0}^n e^{\theta k} \binom{n}{k} 2^{-k}
= \sum_{k=0}^n \binom{n}{k} (e^{\theta}2^{-1})^k
=(1+e^{\theta}2^{-1})^n.
\]
Hence,
\[
\Pr(X > na) \le \left(\frac{1+e^\theta 2^{-1}}{e^{a\theta}}\right)^n,
\]
and the bound holds for any $\theta >0$.
We can get a value for the bound by choosing some specific $\theta$, e.g.\
$\theta=\log 4$, which gives $(3\times 4^{-a})^n$, or we can be smart
and find the best bound by choosing the value of $\theta$ for which the
bound is least.
To find this $\theta$, take the logarithm of the expression
inside the parenthesis, differentiate with respect to $\theta$, and
set the derivative equal to zero:
\begin{gather*}
0= \frac{d}{d\theta}(\log(1+e^\theta 2^{-1}) - a\theta)
= \frac{e^\theta 2^{-1}}{1+e^\theta 2^{-1}} - a,\\
\text{ whence, } e^{\theta} = \frac{2a}{1-a}.
\end{gather*}
For this value, we have
\[
\Pr(X > na) \le \left(\frac{1+\frac{a}{1-a} }{(\frac{2a}{1-a})^a}\right)^n
= 2^{-an} a^{-an} (1-a)^{-(1-a)n}
\]


%%%%%%%%%%%%%%%%%%%%
\paragraph{4.2}
This is an exercise about a nonnegative random variable $Z$
for which we know that $\E Z=0$.
If $Z$ is simple, then it is immediate that $\Pr(Z>0)=0$.
For general $Z$, let $Z_n$ be a sequence of simple random variables
such that $Z_n \uparrow Z$. Then $\{Z > 0\} = \cup_n \{Z_n >0\}$
and since the latter events have $\Pr$ equal to zero, 
it follows that $\Pr(Z >0) =0$.

Now apply this to the random variable $Z= (X-\E X)^2$.
We learnt that $\Pr(Z=0)=1$, i.e.\ $\Pr(X=\E X)=1$.




%%%%%%%%%%%%%%%%%%%%
\paragraph{4.3}
Let $Z = |X-\E X|^2$.
Markov's inequality says
\[
\Pr(Z > t^2) \le \frac{ \E Z}{t^2},
\]
for all $t > 0$.  But 
\[
\Pr(Z > t^2) = \Pr(|X-\E X| > t).
\]



%%%%%%%%%%%%%%%%%%%%
\paragraph{4.4}
Just use the binomial theorem:
\[
(a (X- \E X) + b (Y - \E Y))^2
= a^2 (X- \E X)^2 + 2ab (X- \E X) (Y - \E Y) + b^2 (Y - \E Y)^2
\]



%%%%%%%%%%%%%%%%%%%%
\paragraph{4.5}
Again, use the binomial theorem:
\[
(\lambda X + Y)^2 = \lambda^2 X^2 + 2 \lambda X Y + Y^2.
\]
Hence
\[
Q(\lambda):= \lambda^2 \E X^2 + 2 \lambda \E X Y + \E Y^2 \ge 0
\]
{\em for all values of $\lambda$}.
The polynomial $Q(\lambda)$ is minimised at the $\lambda$ which
solves
\[
0 = Q'(\lambda) = 2\lambda \E X^2 + 2 \E XY,
\]
i.e.\ for $\lambda = - \E XY/ \E X^2$.
Hence
\[
0 \le Q( - \E XY/ \E X^2)
= \frac{ \E X^2 \E Y^2  - (\E XY)^2}{\E X^2},
\]
which gives the inequality we need.




%%%%%%%%%%%%%%%%%%%%
\paragraph{4.6}
Apply the previous inequality to $X-\E X$, $Y -\E Y$
in lieu of $X$, $Y$, respectively.




%%%%%%%%%%%%%%%%%%%%
\paragraph{4.7}
Just use the property $e^{x+y} = e^x e^y$
of the exponential function.
\begin{gather*}
e^{\theta(a+bX)} = e^{\theta a} e^{\theta b X}
\\
\E e^{\theta(a+bX)} = e^{\theta a} \E e^{\theta b X}
= e^{\theta a} M_X(\theta b).
\end{gather*}



%%%%%%%%%%%%%%%%%%%%
\paragraph{4.8}
If $\lambda > \theta$,
\begin{gather*}
M(\theta) = \int_{-\infty}^\infty e^{\theta x} \lambda e^{-\lambda x} dx
= \lambda \int_{-\infty}^\infty e^{-x(\lambda-\theta)} dx
= \frac{\lambda}{\lambda-\theta}.
\end{gather*}
If $\lambda \le \theta$ the integral diverges.
Now,
\[
M'(\theta) = \frac{\lambda}{(\lambda-\theta)^2},
\quad
M''(\theta) = \frac{2\lambda}{(\lambda-\theta)^3},
\]
So,
\[
\E X = M'(0) = \frac{1}{\lambda},
\quad
\E X^2 = M''(0) = \frac{2}{\lambda^2},
\quad
\var X = \E X^2 - (\E X)^2 = \frac{1}{\lambda^2}.
\]




%%%%%%%%%%%%%%%%%%%%
\paragraph{4.9}
A necessary condition for the integral defining $M(\theta)$, for $\theta>0$,
to converge, 
is that the right tail of the density decays exponentially.
This is not so for the Cauchy distribution and so $M(\theta)=\infty$
for $\theta > 0$. By symmetry, $M(\theta)=M(-\theta)$ for $\theta < 0$,
and so $M(\theta)=\infty$, for all values of $\theta \not =0$.



%%%%%%%%%%%%%%%%%%%%
\paragraph{4.10}
Let $Y_1, Y_2$ be real random variables.
The modulus inequality is equivalent to 
\[
\sqrt{\E Y_1^2 + \E Y_2^2} \le \E \sqrt{ Y_1^2 + Y_2^2}.
\]
But, by Jensen's inequality, the square of the right hand side
is larger than or equal to  $\E(Y_1^2+Y_2^2)$,
which proves the inequality.



%%%%%%%%%%%%%%%%%%%%
\paragraph{4.11}
The exponential function satisfies $e^{z+w} = e^z e^w$
for any two complex numbers $z, w$.
\begin{gather*}
e^{it(a+bX)} = e^{ita} e^{itbX}
\\
\E e^{it(a+bX)} = e^{ita} \E e^{itbX} = e^{ita} \phi_X(tb).
\end{gather*}




%%%%%%%%%%%%%%%%%%%%
\paragraph{4.12}
\[
\int_0^1 e^{itu} du = \frac{e^{it}-1}{it}.
\]
If $X$ is uniform on $(a,b)$ then $X= (b-a) U +a$, where $U$ is
uniform on $(0,1)$.




%%%%%%%%%%%%%%%%%%%%
\paragraph{4.13}
We need to show that
\[
\int_0^\infty e^{i\theta x} \lambda e^{-\lambda x} dx
= \frac{\lambda}{\lambda-i\theta }.
\]
Note that the function $f(z) = e^z$ is analytic for all $z \in \C$,
and has itself as primitive.  So
\[
\int_\gamma e^z dz = e^b-e^a,
\]
for any simple curve $\gamma$ with endpoints $a, b \in \C$.
Let $\gamma$ be the curve $z=-c x$, $0 \le x \le x_0$, where
$c$ is a fixed complex number. Then
\[
\int_\gamma e^z dz = \int_0^{x_0} e^{-cx} (-c) dx.
\]
Hence
\[
\int_0^{x_0} e^{-cx} dx = \frac{1-e^{-c x_0}}{c}.
\]
If the real part of $c$ is positive, $\lim_{x_0 \to \infty}
e^{-c x_0} =0$, and so
\[
\int_0^\infty e^{-c x} dx = \frac{1}{c},
\]
which gives what we need if we set $c=\lambda-i\theta$.



%%%%%%%%%%%%%%%%%%%%
\paragraph{4.14}
For $x \le y$, both ranging in $\{1, \ldots, 6\}$,
\begin{gather*}
\Pr(X \ge x, Y \le y)
= \Pr(x \le N_1 \le y,~ x \le N_2 \le y) = \bigg(\frac{y-x}{6}\bigg)^2.
\end{gather*}
The marginals are as follows:
\begin{gather*}
\Pr(X \ge x) = \bigg(\frac{6-x}{6}\bigg)^2
\\
\Pr(Y \le y) = \bigg(\frac{y}{6}\bigg)^2
\end{gather*}
We can work out $\Pr(X=x, Y=y)$ by using the additivity of $\Pr$, or, simply,
by
\[
\Pr(X=x, Y=y) = 2 \Pr(N_1=x, N_2=y) = 1/6, \quad x \le y.
\]
To find the conditional probabilities, just use division.



%%%%%%%%%%%%%%%%%%%%
\paragraph{4.15}
Just do an integral using Fubini:
\[
a^{-1} = \int_{\substack{0 \le x \le 1  \\  0 \le y \le 1}} (x+y^2) d(x,y)
=
\int_{0\le x \le 1} dx \int_{0 \le y \le 1} dy (x+y^2) 
= \frac{1}{2} + \frac{1}{3}.
\]
\[
F_{X,Y}(x,y) = a \int_{\substack{0 \le x' \le x  \\  0 \le y' \le y}} (x'+y'^2) d(x',y')
= a \frac{x^2}{2} y + a x \frac{y^3}{3}.
\]
\begin{gather*}
\Pr(X > Y) = \int_{\substack{0 \le x \le 1  \\  0 \le y \le 1\\ x > y}}
a (x+y^2)
= a \int_{0\le x \le 1} dx \int_{0 \le y \le 1} dy \1(x>y) (x+y^2)
\\
= a \int_{0 \le x \le 1} x^2 dx
+ a \int_{0 \le y \le 1} (1-y) y^2 dy
= a(\tfrac{1}{3} + \tfrac{1}{3} - \tfrac{1}{4}).
\end{gather*}
\begin{gather*}
\Pr(X^2 > Y) = \int_{\substack{0 \le x \le 1  \\  0 \le y \le 1\\ x^2 > y}}
a (x+y^2)
=
a \int_{0\le x \le 1} dx \int_{0 \le y \le 1} dy \1(x^2>y) (x+y^2)
\\
= a \int_{0 \le x \le 1} x^3 dx
+ a \int_{0 \le x \le 1} \frac{(x^2)^3}{3} dx
=a(\tfrac{1}{4} + \tfrac{1}{3\cdot 7}).
\end{gather*}


%%%%%%%%%%%%%%%%%%%%
\paragraph{4.16}
We have that $X, W$ are independent exponentials with $\E X = 2$, $\E W =1$,
and $Y = \tfrac{1}{2}X - W$. As noted, $Y \ge \tfrac{1}{2}X$, 
with probability $1$.
We compute the distribution function in the form
\[
G(x, y) := \Pr (X > x, Y > y),
\]
because it's easier to do the integrals.
The variable $y$ ranges from $-\infty$ to $+\infty$ because $Y$ {\em can} take
negative values.
\begin{gather*}
G(x,y) = \Pr(X > x, X > W+2y)
\\
= \int_0^\infty dw~ e^{-w}~ \Pr(X > x, X > 2w+2y)
= \int_0^\infty dw~ e^{-w}~ \Pr(X > x \vee(2w+2y))
\\
=\int_0^\infty dw~ e^{-w}~ e^{-[(x/2) \vee(w+y)]}
\end{gather*}
This is an easy integral in the variable $w$, as long as we split it
into two integrals: one over $w < (x/2)-y$ and one over $w > (x/2)-y$.
We here assume (I) that $x/2>y$ (otherwise the first integral
is vacuus.)
\begin{gather*}
G(x,y) = \int_0^{(x/2)-y} dw~ e^{-w}~ e^{-x/2}
+ \int_{(x/2)-y} ^\infty dw~ e^{-w}~ e^{-w-y}
\\
= e^{-x/2}
 \int_0^{(x/2)-y} dw~ e^{-w}
+ e^{-y} \int_{(x/2)-y} ^\infty dw~ e^{-2w}
\\
= e^{-x/2}
(1-e^{-\frac{x}{2}+y})
+ \frac{1}{2} e^{-y} e^{-x+2y}
= e^{-x/2} - \frac{1}{2} e^{-x+y}. 
\end{gather*}
If (II) $x/2 < y$ then $(x/2) \vee(w+y) = w+y$ for all $w >0$, and so
\[
G(x,y) = \int_0^\infty dw~ e^{-w}~e^{-w-y} = \frac{1}{2} e^{-y}.
\]
So the answer is:
\[
\Pr(X>x, Y > y) =
\begin{cases}
e^{-x/2} - \frac{1}{2} e^{-x+y}, & \text{ if } x \ge 2y \\
\frac{1}{2} e^{-y}, & \text{ if } x \le 2y.
\end{cases}
\]
We can also find $F_{X,Y}(x,y)$ using additivity:
\[
1-G(x,y) = \Pr( X \le x \text{ or } Y \le y)
= 1-\Pr (X>x) + 1-\Pr(Y>y) - F_{X,Y}(x,y).
\]



%%%%%%%%%%%%%%%%%%%%
\paragraph{4.17}
\begin{gather*}
\E e^{\eta X' + \theta Y'}
= \E e^{\eta (X+Y) + \theta (X-Y)}
= \E e^{(\eta+\theta) X + (\eta-\theta) Y}
\\
= \E e^{(\eta+\theta) X} \E e^{(\eta-\theta) Y}
\\
= e^{(\eta+\theta)^2 } e^{(\eta-\theta)^2}
\\
= e^{2\eta^2+2\theta^2}.
\end{gather*}
Since
\[
e^{2\eta^2+2\theta^2} = e^{2\eta^2} e^{2\theta^2},
\]
$X', Y'$ are independent, both normal with zero mean and variance 2.



%%%%%%%%%%%%%%%%%%%%
\paragraph{4.18}
\begin{gather*}
\sum_{n=0}^\infty e^{-\lambda} \frac{\lambda^n}{n!} (e^\theta n)
= e^{-\lambda} \sum_{n=0}^\infty \frac{(\lambda e^\theta)^n}{n!} 
= e^{-\lambda} e^{\lambda e^\theta}
= e^{\lambda (e^\theta-1)}.
\end{gather*}
See Exercise 5.2 below.



\newpage
\begin{center}{\bf CHAPTER 5}\end{center}


%%%%%%%%%%%%%%%%%%%%
\paragraph{5.1}
This is the same as Exercise 4.1, except that there $p$ was equal to $1/2$.
The method is precisely the same.


%%%%%%%%%%%%%%%%%%%%
\paragraph{5.2}
We use generating functions:
\[
\prod_{j=1}^n M_{X_j}(\theta)
= \prod_{j=1}^n \exp\big(\lambda_j(e^\theta-1)\big)
=  \exp\big(\sum_{j=1}^n \lambda_j(e^\theta-1)\big),
\]
and the latter is the generating function of a Poisson random variable
with rate $\sum_j \lambda_j$.


%%%%%%%%%%%%%%%%%%%%
\paragraph{5.3}
A brute-force proof is as follows:
\begin{gather*}
\Pr(X_1=n_1,\ldots,X_d=n_d \mid X_1+\cdots+X_d=n)
=
\frac{\Pr(X_1=n_1,\ldots,X_d=n_d)}{\Pr(X_1+\cdots+X_d=n)}
\\
= \frac{\displaystyle\prod_{k=1}^d \frac{\lambda_k^{n_k}}{n_k!} e^{-\lambda_k}}
{\frac{\displaystyle\lambda^n}{n!} e^{-\lambda}}
=
\frac{n!}{\prod_{k=1}^d n_k!} \prod_{k=1}^d (\lambda_k/\lambda)^{n_k}
=
\binom{n}{n_1, \ldots, n_d} \prod_{k=1}^d (\lambda_k/\lambda)^{n_k}.
\end{gather*}

(A proof can also be devised by using Exercise 5.8 below.) 


%%%%%%%%%%%%%%%%%%%%
\paragraph{5.4}
Since
\[
\Pr(X > k | X > k-1) = q
\]
we have
\[
\Pr(X> k) = q \Pr(X > k-1) = q^2 \Pr(X > k-2) = \cdots = q^k,
\]
and so $X$ is geometric.
The values $\Pr(X=1)$ is called parameter. 
So the parameter is $\Pr(X=1) = \Pr(X>0)-\Pr(X> 1) = q^0 -q^1 = 1-q$.



%%%%%%%%%%%%%%%%%%%%
\paragraph{5.5}
\[
M(\theta) = \E e^{\theta X} = \sum_{n=1}^\infty
e^{\theta n} (1-p)^{n-1} p 
=p e^\theta \sum_{n=1}^\infty((1-p)e^\theta)^{n-1}=
\frac{p e^\theta}{1-(1-p)e^\theta}.
\]
\[
\E X = M'(0) = 1/p,
\quad
\E X^2 = M''(0) =(2-p)/p^2,
\quad
\var X = (1-p)/p^2.
\]



%%%%%%%%%%%%%%%%%%%%
\paragraph{5.6}
We have
\begin{gather*}
\Pr(X > Y+n, X > Y) = \sum_k \Pr(X > k+n, X > k, Y =k)
\\
= \sum_k \Pr(X>k+n | X > k) \Pr(X>k) \Pr(Y=k)
\\
= \Pr(X>n) \sum_k \Pr(X>k) \Pr(Y=k)
\\
= \Pr(X>n) \Pr(X > Y).
\end{gather*}
Dividing by $\Pr(X > Y)$ we obtain the result.
The result can be interpreted as follows: If $X$ represents the
duration of my sleep (which is geometrically distributed) then:
given that I have not
waken up by the unknown time $Y$ that an explosion will
occur in Australia, my remaining
sleeping time  $X-Y$ will be distributed as $X$, i.e.\ as if the 
explosion occur ed when I went to bed.



%%%%%%%%%%%%%%%%%%%%
\paragraph{5.7}
{From} the formula of density transformation, it is obvious that
$cX+d$ has constant density. Since the function $y=cx+d$
maps the interval $[a,b]$ onto the interval
with endpoints $ca+d$ and $cb+d$, the result follows.



%%%%%%%%%%%%%%%%%%%%
\paragraph{5.8}
We can get the answer easily if we think combinatorially.
We want to compute
\[
\Pr(A) \equiv \Pr(S^1_n = m_1, \ldots, S^d_n = m_n),
\]
for all non-negative integers $m_1, \ldots, m_n$ adding up to $n$.
The probability that the first $m_1$ of the $U_j$'s fall in $I_1$
and the next $m_2$ of them in $I_2$, and so on, equals
$p_1^{m_1} \cdots p_d^{m_d}$.
The event whose probability we just computed is one of the 
many events comprising $A$. Each of these events has exactly the same
probability and there are $\binom{n}{m_1,\ldots,m_d}$ such
events.
Therefore,
\[
\Pr(A) =\binom{n}{m_1,\ldots,m_d} p_1^{m_1} \cdots p_d^{m_d}.
\]

For the analytically minded, we can {\em verify} (and prove) that the result
is correct by checking that the generating functions of both sides
are equal.
First, for the multinomial, we have
\[
\sum 
 \binom{n}{m_1,\ldots,m_d} p_1^{m_1} \cdots p_d^{m_d}
\theta_1^{m_1} \cdots \theta_d^{m_d}
=(p_1\theta_1 + \cdots + p_d\theta_d)^n,
\]
where the sum extends over all non-negative integers $m_1, \ldots, m_n$ 
adding up to $n$, and where we have used the multinomial theorem.
Second, for the probability we are seeking, we have
\[
\sum \Pr(S^1_n = m_1, \ldots, S^d_n = m_n) \theta_1^{m_1} \cdots \theta_d^{m_d}
= \E\big[ \theta_1^{S^1_n} \cdots \theta_d^{S^d_n}\big],
\]
where the sum extends over the same region as before.
The latter further equals
\[
\E \prod_{r=1}^d \prod_{j=1}^n \theta_r^{\1(U_j \in I_r)}
= \E \prod_{j=1}^n \prod_{r=1}^d \theta_r^{\1(U_j \in I_r)}
= \prod_{j=1}^n \E \prod_{r=1}^d \theta_r^{\1(U_j \in I_r)}
\]
The function inside the expectation is a function of $U_j$ only
and is a simple function: it takes value $\theta_r$ with probability
$p_r$; therefore it has expectation $\sum_{r=1}^d p_r \theta_r$.
Hence the two generating functions agree.

%%%%%%%%%%%%%%%%%%%%
\paragraph{5.9}
First note that, with probability $1$, all random variables are distinct.
There are $d!$ ways to order $U_1, \ldots, U_d$.
Since the probabilities of each order are equal and since the
probabilities add up to 1, it follows that the probability
of a specific order is $1/d!$. So $\Pr(U_1 < \cdots < U_d) = 1/d!$.




%%%%%%%%%%%%%%%%%%%%
\paragraph{5.10}
If $X, Y, Z$ are the lengths of the sticks then $X+Y+Z=1$, and the
sticks form a triangle\footnote{Euclid (ca.\ $-300$): 
{\em Elements}, Alexandria.}
if (from Euclidean Geometry)
each of the sticks has length smaller than the sum of the lengths
of the other two:
\begin{align*}
X & \le Y+Z \\
Y & \le Z+X \\
Z & \le X+Y.
\end{align*}
The model for stick breaking is, undoubtedly, as follows: Let the stick
be the interval $[0,1]=\{x\in \R:~0 \le x \le 1\}$. 
Pick two i.i.d.\ random variables
$B_1, B_2$, uniformly distributed in this interval. These represent
the break points. Let $U=B_1 \wedge B_2$, $V=B_1 \vee B_2$.
The intervals $[0,U], [U, V], [V,1]$ represent the three smaller sticks,
and have lengths $X=U$, $Y=V-U$, $Z=1-V$.
Therefore the above inequalities are written as
\begin{gather*}
U  \le 1/2\\
V-U  \le 1/2\\
V  \ge 1/2.
\end{gather*}
We thus need to compute the probability
\[
p= \Pr(U  \le 1/2, V  \ge 1/2, V-U  \le 1/2).
\]
Since $X_1, X_2$ are interchangeable,
\[
p = 2 \Pr(X_1 \le X_2, X_1  \le 1/2, X_2  \ge 1/2, X_2-X_1  \le 1/2).
\]
Since $(X_1,X_2)$ is uniformly distributed in the square $[0,1]^2$,
it's obvious that $p/2$ is the area of the set
\[
\{(x_1,x_2)\in [0,1]^2:~
x_1 \le x_2, x_1  \le 1/2, x_2  \ge 1/2, x_2-x_1  \le 1/2\},
\]
which is a right isosceles triangle two sides of which have length $1/2$ and
thus its area is $1/8$. Hence $p=1/4$.







%%%%%%%%%%%%%%%%%%%%
\paragraph{5.11}
We give the intuition behind this identity in law.
Imagine you have $d$ alarms in your bedroom, each set to ring
at an exponential time with rate 1 (hour$^{-1}$, say). 
The alarms function independently
of one another.  (This ensures that you will, at some point, get out
of bed.)
The first alarm will ring at a time (the minimum of $d$ i.i.d.\
exponential random variables) which is exponentially
distributed with rate the sum of the rates, i.e.\ rate $d$.
In other words, the first alarm rings at time $X_1/d$, where $X_1$ is an 
exponential random variable with rate $1$.
After the first alarm rings, there are $d-1$ alarms remaining.
Note two things: (i) by the memoryless property, the remaining times
are independent of the first ring and (ii) they are independent of the
first ring. Therefore, the second alarm will ring at a remaining time 
which is exponential with rate $d-1$.
In other words, the second alarm rings at a time $X_2/{d-1}$ (where $X_2$ is an 
exponential random variable with rate $1$) {\em after} the first ring.
Thus, the second alarm rings at time distributed like
\[
\frac{X_1}{d} + \frac{X_2}{d-1}
\]
where $X_1, X_2$ are i.i.d.\ Exp$(1)$.
Continuing in this manner, we see that the $d$-th alarm will ring
at time
\[
\frac{X_1}{d} + \frac{X_2}{d-1} + \cdots + \frac{X_{d-1}}{2} + X_d,
\]
where $X_1, \ldots, X_d$ are i.i.d.\ Exp$(1)$.

You {\em can} make the argument formal by first proving the analogue
of Exercise 5.6, namely that if $X, Y$ are independent positive random
variables, with $X$ being exponential, then
\[
\Pr(X-Y > t| X>Y) = \Pr(X>t),
\]
for all $t >0$, and then by using induction.






%%%%%%%%%%%%%%%%%%%%
\paragraph{5.12}
This follows immediately from Exercise 3.4. But let's prove it directly.
\[
\Pr( -\ln U/\lambda > t) = \Pr(U < e^{-\lambda t}) = e^{-\lambda},
\]
because $U$ is uniform.


%%%%%%%%%%%%%%%%%%%%
\paragraph{5.13}
This is called {\em regenerative property} of the Gamma function.
We have
\begin{gather*}
\Gamma(\beta) = \int_0^\infty y^{\beta-1} (-e^{-y})' dy
= [y^{\beta-1} e^{-y}]_0^\infty - \int_0^\infty (-e^{-y}) (y^{\beta-1})' dy
\\
=\int_0^\infty e^{-y} (\beta-1) y^{\beta-2} dy = (\beta-1) \Gamma(\beta-1).
\end{gather*}
A few remarks on rigour: We take $\beta > 1$, so that is why the value of
$y^{\beta-1} e^{-y}$ at $y=0$ equals $0$. Second, $y^{\beta-1} e^{-y} \to 0$,
as $y \to \infty$, that is why $[y^{\beta-1} e^{-y}]_0^\infty =0$.
Third, all integrals in the derivation above converge.

%%%%%%%%%%%%%%%%%%%%
\paragraph{5.14}
We have
\[
\Gamma(1/2) = \int_0^\infty y^{-1/2} e^{-y} dy.
\]
Change variable by
\[
y = x^2/2
\]
so that
\[
y^{-1/2} = \frac{\sqrt{2}}{x}, \quad
e^{-y} = e^{-x^2/2},
\quad
dy = x dx.
\]
Then
\[
\Gamma(1/2) = \sqrt{2} \int_0^\infty e^{-x^2/2}
= \sqrt{2} \sqrt{2\pi}  \frac{1}{\sqrt{2\pi}} \int_0^\infty e^{-x^2/2}
= 2 \sqrt{\pi} \Pr(N >0),
\]
where $N$ is a standard normal random variable. So $\Pr(N>0)=1/2$,
and the result follows.

%%%%%%%%%%%%%%%%%%%%
\paragraph{5.15}
Here $X$ has law $\Gamma(\beta, \lambda)$, where $\beta, \lambda >0$. 
Picking $\theta$ small enough so that the integral below converges (we
will see later how small), we have
\begin{align*}
M_X(\theta) 
&= \int e^{\theta x} \frac{\lambda^\beta}{\Gamma(\beta)}
x^{\beta-1} e^{-\lambda x} dx
\\
&= \frac{\lambda^\beta}{\Gamma(\beta)} 
\int x^{\beta-1} e^{-(\lambda-\theta) x} dx
\\
&= \frac{\lambda^\beta}{\Gamma(\beta)} \frac{1}{(\lambda-\theta)^\beta}
\int y^{\beta-1} e^{-y} dy
\\
&= \frac{\lambda^\beta}{\Gamma(\beta)} \frac{1}{(\lambda-\theta)^\beta}
\Gamma(\beta)
\\
&= \left( \frac{\lambda}{\lambda-\theta} \right)^\beta.
\end{align*}
Looking at the second line above, we see that the integral converges
for all $\theta \in (-\infty, \lambda)$, and diverges if $\theta \ge \lambda$.

Compute a couple of derivatives:
\begin{gather*}
M'(\theta) = \beta \left( \frac{\lambda}{\lambda-\theta} \right)^{\beta-1}
\frac{\lambda}{(\lambda-\theta)^2}
\\
M''(\theta) = 
\left( {\frac {\lambda}{\lambda-\theta}} \right) ^{\beta}{\beta}^{2} \left( \lambda-\theta \right) ^{
-2}+ \left( {\frac {\lambda}{\lambda-\theta}} \right) ^{\beta}\beta \left( \lambda-\theta \right) ^{-2}
\end{gather*}
Set $\theta=0$:
\[
\E X = M'(0) = 
\frac{\beta}{\lambda},
\quad
\E X^2 = 
\frac{\beta^2}{\lambda^2} + \frac{\beta}{\lambda}.
\]


%%%%%%%%%%%%%%%%%%%%
\paragraph{5.16}
Let (see Exercise 5.15)
\[
M_{\beta,\lambda}(\theta)
=
\left( \frac{\lambda}{\lambda-\theta} \right)^\beta
\]
be the generating function of a $\Gamma(\beta,\lambda)$ probability measure.
Then
\[
M_{\beta_1,\lambda}(\theta) M_{\beta_2,\lambda}(\theta)
=
\left( \frac{\lambda}{\lambda-\theta} \right)^{\beta_1+\beta_2}
= M_{\beta_1+\beta_2,\lambda}(\theta),
\]
and this proves the claim, because the generating function
(being a Laplace transform) characterises
the measure.




%%%%%%%%%%%%%%%%%%%%
\paragraph{5.17}
By changing variable $t=x/\sqrt{2}$, it is enough to prove that
\[
I:= \int_{-\infty}^\infty e^{-t^2} dt = \sqrt{\pi},
\]
But
\[
I^2 = \left( \int_{-\infty}^\infty e^{-x^2} dx \right)
\left( \int_{-\infty}^\infty e^{-y^2} dy \right)
\]
and, by Fubini's theorem,
\[
I^2 =  \int_{\R^2} e^{-(x^2+y^2)} d(x,y).
\]
Since the function to be integrated is rotationally invariant on
the plane, we use polar coordinates, i.e.\
\[
x= r \cos \theta, \quad y = r \sin \theta,
\quad r > 0,~~ 0 \le \theta < 2\pi.
\]
Since $x^2+y^2 = r^2$, and since $d(x,y) = r d(\rho,\theta)$, we have
\[
I^2 = \int_{\R^2} e^{-r^2} r d(r,\theta).
\]
Using Fubini's theorem once more,
\[
I^2 = \int_0^\infty dr ~r~ e^{-r^2} \int_0^{2\pi} d\theta
= 2 \pi \int_0^\infty \tfrac{1}{2} s e^{-s} ds = \pi.
\]
So, clearly,\footnote{
Lord Kelvin (1824-1907) was an admirer of Joseph Liouville. It
is said that, one day,
while Kelvin was lecturing in {\em Glasgow}, he asked his class:
`Do you know what a mathematician is?' He then wrote the following
equation on the blackboard
\[
\int_{-\infty}^\infty e^{-x^2} dx = \sqrt{\pi},
\]
and said: `A mathematician is one to whom that is as obvious as that
$2 \times 2 = 4$ is to you; Liouville was a mathematician.'
}
$I=\sqrt{\pi}$, 

%%%%%%%%%%%%%%%%%%%%
\paragraph{5.18}
First, complete the square in the exponent:
\[
\tfrac{1}{2} x^2 - \theta x
= \tfrac{1}{2}(x^2-2\theta x + \theta^2-\theta^2) 
= \tfrac{1}{2}(x-\theta)^2 - \tfrac{1}{2} \theta^2.
\]
Therefore,
\begin{align*}
M_X(\theta) 
&= \frac{1}{\sqrt{2\pi}} \int_{-\infty}^\infty
e^{-\tfrac{1}{2}(x-\theta)^2 + \tfrac{1}{2} \theta^2} dx
\\
&= e^{\tfrac{1}{2} \theta^2} \frac{1}{\sqrt{2\pi}} \int_{-\infty}^\infty
e^{-\tfrac{1}{2}(x-\theta)^2 } dx
\\
&= e^{\tfrac{1}{2} \theta^2} \frac{1}{\sqrt{2\pi}} \int_{-\infty}^\infty
e^{-\tfrac{1}{2}y^2 } dy
\\
&=  e^{\tfrac{1}{2}},
\end{align*}
because the last integral is the integral of a standard normal density,
and hence it equals 1.
%%%%%%%%%%%%%%%%%%%%
\paragraph{5.19}
Recall the ``stability property'' of the Gamma distribution,
namely, if $X_{\beta_j, \lambda}$, $j=1,2$ are {\em independent}
random variables with laws $\Gamma(\beta_i, \lambda)$, respectively,
then $X_{\beta_1,\lambda}+X_{\beta_2,\lambda}$ has law
$\Gamma(\beta_1+\beta_2, \lambda)$.

Here, $Y_1^2$, $Y_2^2$ are independent, both with law $\Gamma(1/2,1/2)$.
Hence $Y_1^2 + Y_2^2$ has law $\Gamma(1,1/2) = Exp(1/2)$.


%%%%%%%%%%%%%%%%%%%%
\paragraph{5.20}
This requires reviewing the material you learnt and just 
summarising in an artsy manner.

%%%%%%%%%%%%%%%%%%%%
\paragraph{5.21}
Let $U = X+2Y$, $V=3X-4Y$. We want to compute $\E (U|V)$.
We know that\\
1) $\E (U|V) = c V$, for some constant $c$,\\
2) $U-\E(U|V)$ is independent of $V$.\\
Therefore $U-cV$ and $V$ are uncorrelated:
\[
0 = \E((U-cV)V) = \E UV - c \E V^2,
\]
whence
\[
c= \frac{\E UV}{\E V^2}.
\]
We have
\begin{align*}
\E UV &= \E(X+2Y)(3X-4Y) = 3 \E X^2 - 8 \E Y^2 + 0 = 3-8 =-5,\\
\E V^2 &= \E(3X-4Y)^2 = 9 \E X^2 + 16 \E Y^2 + 0 = 25.
\end{align*}
So $c = -5/25 = -1/5$, and so $\E(U|V) = -V/5$.








\end{document}
